package dto

import "miao/models"

type UserDto struct {
	Id       string   `json:"id"`
	Username string   `json:"username"`
	Email    string   `json:"email"`
	Nickname string   `json:"nickname"`
	Password string   `json:"password"`
	Roles    []string `json:"roles"`
}

func GetAuthDTO(user *models.UserBase, roles []models.RoleBase) UserDto {
	return UserDto{
		Id:       user.Id,
		Username: user.Username,
		Email:    user.Email,
		Nickname: user.Nickname,
		Password: "",
		Roles:    ToStringList(roles),
	}
}
